package pub.wkq.thread;

import java.util.concurrent.TimeUnit;

public class Nap {
    public Nap(double t) {//秒
        try {
            TimeUnit.MILLISECONDS.sleep((long) (1000 * t));
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
    public Nap(double t,String msg){
        this(t);
        System.out.println(msg);
    }
}
